package com.novax.ex.activity.open.model.response.task;

import com.novax.ex.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;


@Schema(description = "ET奖励情况")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class TaskEtRewardsResponse extends BaseEntity {
    @Schema(description = "用户id")
    private Long userId;
    @Schema(description = "总冻结数量")
    private BigDecimal totalFreeze;
    @Schema(description = "解冻数量")
    private BigDecimal unfreeze;
    @Schema(description = "币种")
    private String currency;
    @Schema(description = "未解冻数量")
    private BigDecimal awaitUnfreeze;
    @Schema(description = "版本")
    private Long version;

    public TaskEtRewardsResponse(BigDecimal totalFreeze, BigDecimal unfreeze) {
        this.totalFreeze = totalFreeze;
        this.unfreeze = unfreeze;
    }

    public BigDecimal getAwaitUnfreeze() {
        return totalFreeze.subtract(unfreeze);
    }
}
